               <!-- Script réalisé par BOUFTIH Fadwa -->
{extends file="skulton.tpl"}{/extends}
{block name="monblock"}
<script src="scripts/js/Form.js"></script>
<script type="text/javascript" charset="utf-8">
	var asInitVals = new Array();
	$(document).ready(function() {
//dialog confirmer la suppression
		  $(".yesno").click(function(){
				var a = $(this);
				$( "#dialog-confirm" ).dialog({
						resizable: false,
						modal: true,
						buttons: {
							"Oui": function() {
								
								document.location.href="abscence.php?id_sup="+a.attr('id');
							},
							"Non": function() {
								$( this ).dialog( "close" );
							}
						}
				});
			});
	//dataTable
		var oTable = $('#idtable').dataTable( {
			"sPaginationType": "full_numbers",
			"oLanguage": {
				"sSearch": "Rechercher:"
			}
		} );

		//recherche spécifique à la colone
		$("tfoot input").keyup( function () {
			/* Filter les column  */
			oTable.fnFilter( this.value, $("tfoot input").index(this) );
		} );
		 
		// tfoot de dataTable
		$("tfoot input").each( function (i) {
			asInitVals[i] = this.value;
		} );
		 
		$("tfoot input").focus( function () {
			if ( this.className == "search_init" )
			{
				this.className = "";
				this.value = "";
			}
		} );
		 
		$("tfoot input").blur( function (i) {
			if ( this.value == "" )
			{
				this.className = "search_init";
				this.value = asInitVals[$("tfoot input").index(this)];
			}
		} );
	
	} );
</script>	
<div class="content-box"><!-- contenu du body-->
	<div class="content-box-header">
		
		<h3>Liste des abscences</h3> <!--titre-->
	</div> <!-- End .content-box-:>header -->  
	<div class="tab-content default-tab" id="tab1"> 
	{if isset($message)}
		<div class="notification success png_bg">
			<a href="#" class="close"><img src="images/icons/cross_grey_small.png" title="Close thisnotification" alt="close"></a>
			<div>
				{$message}
			</div>
	    </div>
	{/if}	
			
	<div style="display:none;" id="dialog-confirm" title="Demande de confirmation">
		<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment supprimer cet enregistrement ?</p>
	</div>
			<table id="idtable">
				
				<thead>
					<tr>
					   <th><input class="check-all" type="checkbox" /></th>
					   <th>Nomade abscent<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					   <th>Désignation de la tache<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					   <th>Motif d'abscence<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					   <th>Date D'abscence<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					    <th>Suppression</th>
					</tr>
				</thead>
			
				<tbody>
				  {foreach $return as $abscence}
					<tr>	
						<td><input type="checkbox" /></td>
						<td>{$nomadeDao->loadNomade($abscence->getIdNomade())->getNom()} {$nomadeDao->loadNomade($abscence->getIdNomade())->getPrenom()}</td>
						<td>{$abscence->getDesignationTache()}</td>
						<td>{$abscence->getCause()}</td>
					    <td>{$abscence->getDateAbscence()}</td>
						<td>
							 <a href="#" title="Delete" class="yesno with-tip supp" id="{$abscence->getIdAbscence()}"><img src="images/icons/cross.png" alt="Delete" /></a>     
						</td>
					</tr>
				  {/foreach}
				</tbody>
				
				<tfoot>
					<tr>
						<th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
						<th><input type="text" name="search_nomade" value="" class="search_int" /></th>
						<th><input type="text" name="search_cause" value="" class="search_int"  /></th>
						<th><input type="text" name="search_dateAbscence" value="" class="search_int"  /></th>
						<th><input type="text" name="search_designation" value="" class="search_int" style="display:none" /></th>
					</tr>
				</tfoot>
				
			</table>
	
		</div> <!-- fin #tab2 -->        
		
	</div> <!--  fin.content-box-content -->

{/block}